package com.bjsxt.livegoods.search.service.controller;

import com.bjsxt.livegoods.search.service.service.SearchService;
import com.bjsxt.livegoods.search.serviceapi.SearchServiceAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class SearchServiceController implements SearchServiceAPI {

    @Autowired(required = false)
    private SearchService searchService;
    @Override
    public Map<String, Object> searchProducts(String city, String content, int page, int rows) {
        return searchService.searchProducts(city,content,page,rows);
    }
    /**
     * 只是为环境的完整提供的一个服务。与项目开发没有直接关系
     */
    @GetMapping("/sync")
    public Object sync(){
        searchService.sync();
        return "同步结束";
    }
}
